[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 getfillpattern()        Get User-Defined Fill Pattern

 #include   <graphics.h>

 void far   getfillpattern(upattern);
 char far   *upattern;

    getfillpattern() gets the user-defined fill pattern (created with
    setfillpattern()) and puts it in the area pointed to by 'upattern'.
    'upattern' points to a sequence of 8 bytes.  Each byte corresponds to
    8 pixels in the pattern.  If a bit in the pattern byte is set to 1,
    the corresponding pixel is drawn.

    Returns:    Nothing.

   -------------------------------- Example ---------------------------------

    The following statements get a user-defined fill pattern and then
    draw bar graphs using that fill pattern.

           #include <graphics.h>
           #include <conio.h>

           int gdriver = DETECT;
           int gmode;

           main()
           {
               struct fillsettingstype saveset;
               char savepat[8];
               char mypattern[8] = {0xCC,0x33,0xCC,0x33,0xCC,0x33,0xCC,0x33};

               initgraph(&gdriver,&gmode,"");
               setfillpattern(mypattern,BLUE);
               getfillsettings(&saveset);
               if (saveset.pattern == USER_FILL)
               getfillpattern(savepat);
               bar(10,10,100,100);
               setfillpattern(savepat,RED);
               bar(200,10,300,100);
               setfillpattern(savepat,saveset.color);
               bar(400,10,500,100);
               getch();
               closegraph();
           }


See Also: fillpoly() floodfill() getfillsettings() setfillstyle()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson